let io = null
const initIO = (server) => {
  console.log('初始化socketio');
  io = require("socket.io")(server);
  /**
   * 初始化socket.io连接
   */
  io.on("connection", (socket) => {
    console.log("服务端有一个连接");
    // io.emit('curdtest', 'test')
  });
};

const getIOInstance = function () {
  return io
} 

module.exports = {
  initIO,
  getIOInstance
}